<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE Trustworthy #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE CPP, NoImplicitPrelude #-}</span><span>
</span><span id="line-3"></span><span>
</span><span id="line-4"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-5"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-6"></span><span class="hs-comment">-- Module      :  Foreign.Marshal.Error</span><span>
</span><span id="line-7"></span><span class="hs-comment">-- Copyright   :  (c) The FFI task force 2001</span><span>
</span><span id="line-8"></span><span class="hs-comment">-- License     :  BSD-style (see the file libraries/base/LICENSE)</span><span>
</span><span id="line-9"></span><span class="hs-comment">-- </span><span>
</span><span id="line-10"></span><span class="hs-comment">-- Maintainer  :  ffi@haskell.org</span><span>
</span><span id="line-11"></span><span class="hs-comment">-- Stability   :  provisional</span><span>
</span><span id="line-12"></span><span class="hs-comment">-- Portability :  portable</span><span>
</span><span id="line-13"></span><span class="hs-comment">--</span><span>
</span><span id="line-14"></span><span class="hs-comment">-- Routines for testing return values and raising a 'userError' exception</span><span>
</span><span id="line-15"></span><span class="hs-comment">-- in case of values indicating an error state.</span><span>
</span><span id="line-16"></span><span class="hs-comment">--</span><span>
</span><span id="line-17"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-18"></span><span>
</span><span id="line-19"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Foreign.Marshal.Error</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-20"></span><span>  </span><span class="annot"><a href="Foreign.Marshal.Error.html#throwIf"><span class="hs-identifier">throwIf</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-21"></span><span>  </span><span class="annot"><a href="Foreign.Marshal.Error.html#throwIf_"><span class="hs-identifier">throwIf_</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-22"></span><span>  </span><span class="annot"><a href="Foreign.Marshal.Error.html#throwIfNeg"><span class="hs-identifier">throwIfNeg</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-23"></span><span>  </span><span class="annot"><a href="Foreign.Marshal.Error.html#throwIfNeg_"><span class="hs-identifier">throwIfNeg_</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-24"></span><span>  </span><span class="annot"><a href="Foreign.Marshal.Error.html#throwIfNull"><span class="hs-identifier">throwIfNull</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-25"></span><span>
</span><span id="line-26"></span><span>  </span><span class="hs-comment">-- Discard return value</span><span>
</span><span id="line-27"></span><span>  </span><span class="hs-comment">--</span><span>
</span><span id="line-28"></span><span>  </span><span class="annot"><a href="Foreign.Marshal.Error.html#void"><span class="hs-identifier">void</span></a></span><span>
</span><span id="line-29"></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-30"></span><span>
</span><span id="line-31"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Foreign.Ptr.html"><span class="hs-identifier">Foreign.Ptr</span></a></span><span>
</span><span id="line-32"></span><span>
</span><span id="line-33"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Base.html"><span class="hs-identifier">GHC.Base</span></a></span><span>
</span><span id="line-34"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Num.html"><span class="hs-identifier">GHC.Num</span></a></span><span>
</span><span id="line-35"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.IO.Exception.html"><span class="hs-identifier">GHC.IO.Exception</span></a></span><span>
</span><span id="line-36"></span><span>
</span><span id="line-37"></span><span class="hs-comment">-- exported functions</span><span>
</span><span id="line-38"></span><span class="hs-comment">-- ------------------</span><span>
</span><span id="line-39"></span><span>
</span><span id="line-40"></span><span class="hs-comment">-- |Execute an 'IO' action, throwing a 'userError' if the predicate yields</span><span>
</span><span id="line-41"></span><span class="hs-comment">-- 'True' when applied to the result returned by the 'IO' action.</span><span>
</span><span id="line-42"></span><span class="hs-comment">-- If no exception is raised, return the result of the computation.</span><span>
</span><span id="line-43"></span><span class="hs-comment">--</span><span>
</span><span id="line-44"></span><span id="local-6989586621679538386"><span class="annot"><a href="Foreign.Marshal.Error.html#throwIf"><span class="hs-identifier hs-type">throwIf</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679538386"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span class="hs-special">)</span><span>  </span><span class="hs-comment">-- ^ error condition on the result of the 'IO' action</span><span>
</span><span id="line-45"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679538386"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- ^ computes an error message from erroneous results</span><span>
</span><span id="line-46"></span><span>                        </span><span class="hs-comment">-- of the 'IO' action</span><span>
</span><span id="line-47"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679538386"><span class="hs-identifier hs-type">a</span></a></span><span>         </span><span class="hs-comment">-- ^ the 'IO' action to be executed</span><span>
</span><span id="line-48"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679538386"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-49"></span><span id="throwIf"><span class="annot"><span class="annottext">throwIf :: forall a. (a -&gt; Bool) -&gt; (a -&gt; String) -&gt; IO a -&gt; IO a
</span><a href="Foreign.Marshal.Error.html#throwIf"><span class="hs-identifier hs-var hs-var">throwIf</span></a></span></span><span> </span><span id="local-6989586621679538347"><span class="annot"><span class="annottext">a -&gt; Bool
</span><a href="#local-6989586621679538347"><span class="hs-identifier hs-var">pred</span></a></span></span><span> </span><span id="local-6989586621679538346"><span class="annot"><span class="annottext">a -&gt; String
</span><a href="#local-6989586621679538346"><span class="hs-identifier hs-var">msgfct</span></a></span></span><span> </span><span id="local-6989586621679538345"><span class="annot"><span class="annottext">IO a
</span><a href="#local-6989586621679538345"><span class="hs-identifier hs-var">act</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span>
</span><span id="line-50"></span><span>  </span><span class="hs-keyword">do</span><span>
</span><span id="line-51"></span><span>    </span><span id="local-6989586621679538344"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679538344"><span class="hs-identifier hs-var">res</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO a
</span><a href="#local-6989586621679538345"><span class="hs-identifier hs-var">act</span></a></span><span>
</span><span id="line-52"></span><span>    </span><span class="hs-special">(</span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">a -&gt; Bool
</span><a href="#local-6989586621679538347"><span class="hs-identifier hs-var">pred</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679538344"><span class="hs-identifier hs-var">res</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">IOError -&gt; IO a
forall a. IOError -&gt; IO a
</span><a href="GHC.IO.Exception.html#ioError"><span class="hs-identifier hs-var">ioError</span></a></span><span> </span><span class="annot"><span class="annottext">(IOError -&gt; IO a) -&gt; (a -&gt; IOError) -&gt; a -&gt; IO a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; IOError
</span><a href="GHC.IO.Exception.html#userError"><span class="hs-identifier hs-var">userError</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; IOError) -&gt; (a -&gt; String) -&gt; a -&gt; IOError
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; String
</span><a href="#local-6989586621679538346"><span class="hs-identifier hs-var">msgfct</span></a></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">a -&gt; IO a
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679538344"><span class="hs-identifier hs-var">res</span></a></span><span>
</span><span id="line-53"></span><span>
</span><span id="line-54"></span><span class="hs-comment">-- |Like 'throwIf', but discarding the result</span><span>
</span><span id="line-55"></span><span class="hs-comment">--</span><span>
</span><span id="line-56"></span><span id="local-6989586621679538377"><span class="annot"><a href="Foreign.Marshal.Error.html#throwIf_"><span class="hs-identifier hs-type">throwIf_</span></a></span><span>                 </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679538377"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679538377"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679538377"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span><span>
</span><span id="line-57"></span><span id="throwIf_"><span class="annot"><span class="annottext">throwIf_ :: forall a. (a -&gt; Bool) -&gt; (a -&gt; String) -&gt; IO a -&gt; IO ()
</span><a href="Foreign.Marshal.Error.html#throwIf_"><span class="hs-identifier hs-var hs-var">throwIf_</span></a></span></span><span> </span><span id="local-6989586621679538340"><span class="annot"><span class="annottext">a -&gt; Bool
</span><a href="#local-6989586621679538340"><span class="hs-identifier hs-var">pred</span></a></span></span><span> </span><span id="local-6989586621679538339"><span class="annot"><span class="annottext">a -&gt; String
</span><a href="#local-6989586621679538339"><span class="hs-identifier hs-var">msgfct</span></a></span></span><span> </span><span id="local-6989586621679538338"><span class="annot"><span class="annottext">IO a
</span><a href="#local-6989586621679538338"><span class="hs-identifier hs-var">act</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO a -&gt; IO ()
forall a. IO a -&gt; IO ()
</span><a href="Foreign.Marshal.Error.html#void"><span class="hs-identifier hs-var">void</span></a></span><span> </span><span class="annot"><span class="annottext">(IO a -&gt; IO ()) -&gt; IO a -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(a -&gt; Bool) -&gt; (a -&gt; String) -&gt; IO a -&gt; IO a
forall a. (a -&gt; Bool) -&gt; (a -&gt; String) -&gt; IO a -&gt; IO a
</span><a href="Foreign.Marshal.Error.html#throwIf"><span class="hs-identifier hs-var">throwIf</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; Bool
</span><a href="#local-6989586621679538340"><span class="hs-identifier hs-var">pred</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; String
</span><a href="#local-6989586621679538339"><span class="hs-identifier hs-var">msgfct</span></a></span><span> </span><span class="annot"><span class="annottext">IO a
</span><a href="#local-6989586621679538338"><span class="hs-identifier hs-var">act</span></a></span><span>
</span><span id="line-58"></span><span>
</span><span id="line-59"></span><span class="hs-comment">-- |Guards against negative result values</span><span>
</span><span id="line-60"></span><span class="hs-comment">--</span><span>
</span><span id="line-61"></span><span id="local-6989586621679538371"><span class="annot"><a href="Foreign.Marshal.Error.html#throwIfNeg"><span class="hs-identifier hs-type">throwIfNeg</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Classes.html#Ord"><span class="hs-identifier hs-type">Ord</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679538371"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Num.html#Num"><span class="hs-identifier hs-type">Num</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679538371"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679538371"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679538371"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679538371"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-62"></span><span id="throwIfNeg"><span class="annot"><span class="annottext">throwIfNeg :: forall a. (Ord a, Num a) =&gt; (a -&gt; String) -&gt; IO a -&gt; IO a
</span><a href="Foreign.Marshal.Error.html#throwIfNeg"><span class="hs-identifier hs-var hs-var">throwIfNeg</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; Bool) -&gt; (a -&gt; String) -&gt; IO a -&gt; IO a
forall a. (a -&gt; Bool) -&gt; (a -&gt; String) -&gt; IO a -&gt; IO a
</span><a href="Foreign.Marshal.Error.html#throwIf"><span class="hs-identifier hs-var">throwIf</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; a -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3C"><span class="hs-operator hs-var">&lt;</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><span class="hs-number">0</span></span><span class="hs-special">)</span><span>
</span><span id="line-63"></span><span>
</span><span id="line-64"></span><span class="hs-comment">-- |Like 'throwIfNeg', but discarding the result</span><span>
</span><span id="line-65"></span><span class="hs-comment">--</span><span>
</span><span id="line-66"></span><span id="local-6989586621679538368"><span class="annot"><a href="Foreign.Marshal.Error.html#throwIfNeg_"><span class="hs-identifier hs-type">throwIfNeg_</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Classes.html#Ord"><span class="hs-identifier hs-type">Ord</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679538368"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Num.html#Num"><span class="hs-identifier hs-type">Num</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679538368"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679538368"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679538368"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span><span>
</span><span id="line-67"></span><span id="throwIfNeg_"><span class="annot"><span class="annottext">throwIfNeg_ :: forall a. (Ord a, Num a) =&gt; (a -&gt; String) -&gt; IO a -&gt; IO ()
</span><a href="Foreign.Marshal.Error.html#throwIfNeg_"><span class="hs-identifier hs-var hs-var">throwIfNeg_</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; Bool) -&gt; (a -&gt; String) -&gt; IO a -&gt; IO ()
forall a. (a -&gt; Bool) -&gt; (a -&gt; String) -&gt; IO a -&gt; IO ()
</span><a href="Foreign.Marshal.Error.html#throwIf_"><span class="hs-identifier hs-var">throwIf_</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; a -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3C"><span class="hs-operator hs-var">&lt;</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><span class="hs-number">0</span></span><span class="hs-special">)</span><span>
</span><span id="line-68"></span><span>
</span><span id="line-69"></span><span class="hs-comment">-- |Guards against null pointers</span><span>
</span><span id="line-70"></span><span class="hs-comment">--</span><span>
</span><span id="line-71"></span><span id="local-6989586621679538366"><span class="annot"><a href="Foreign.Marshal.Error.html#throwIfNull"><span class="hs-identifier hs-type">throwIfNull</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679538366"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679538366"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-72"></span><span id="throwIfNull"><span class="annot"><span class="annottext">throwIfNull :: forall a. String -&gt; IO (Ptr a) -&gt; IO (Ptr a)
</span><a href="Foreign.Marshal.Error.html#throwIfNull"><span class="hs-identifier hs-var hs-var">throwIfNull</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Ptr a -&gt; Bool) -&gt; (Ptr a -&gt; String) -&gt; IO (Ptr a) -&gt; IO (Ptr a)
forall a. (a -&gt; Bool) -&gt; (a -&gt; String) -&gt; IO a -&gt; IO a
</span><a href="Foreign.Marshal.Error.html#throwIf"><span class="hs-identifier hs-var">throwIf</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Ptr a -&gt; Ptr a -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr a
forall a. Ptr a
</span><a href="GHC.Ptr.html#nullPtr"><span class="hs-identifier hs-var">nullPtr</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">((Ptr a -&gt; String) -&gt; IO (Ptr a) -&gt; IO (Ptr a))
-&gt; (String -&gt; Ptr a -&gt; String)
-&gt; String
-&gt; IO (Ptr a)
-&gt; IO (Ptr a)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; Ptr a -&gt; String
forall a b. a -&gt; b -&gt; a
</span><a href="GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span>
</span><span id="line-73"></span><span>
</span><span id="line-74"></span><span class="hs-comment">-- |Discard the return value of an 'IO' action</span><span>
</span><span id="line-75"></span><span class="hs-comment">--</span><span>
</span><span id="line-76"></span><span id="local-6989586621679538375"><span class="annot"><a href="Foreign.Marshal.Error.html#void"><span class="hs-identifier hs-type">void</span></a></span><span>     </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679538375"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span><span>
</span><span id="line-77"></span><span id="void"><span class="annot"><span class="annottext">void :: forall a. IO a -&gt; IO ()
</span><a href="Foreign.Marshal.Error.html#void"><span class="hs-identifier hs-var hs-var">void</span></a></span></span><span> </span><span id="local-6989586621679538322"><span class="annot"><span class="annottext">IO a
</span><a href="#local-6989586621679538322"><span class="hs-identifier hs-var">act</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO a
</span><a href="#local-6989586621679538322"><span class="hs-identifier hs-var">act</span></a></span><span> </span><span class="annot"><span class="annottext">IO a -&gt; IO () -&gt; IO ()
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; m b -&gt; m b
</span><a href="GHC.Base.html#%3E%3E"><span class="hs-operator hs-var">&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">() -&gt; IO ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-78"></span><span class="hs-pragma">{-# DEPRECATED</span><span> </span><span class="hs-pragma">void</span><span> </span><span class="hs-pragma">&quot;use 'Control.Monad.void' instead&quot;</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="hs-comment">-- deprecated in 7.6</span><span>
</span><span id="line-79"></span></pre></body></html>